- 
                Notifications
    You must be signed in to change notification settings 
- Fork 234
u128 and Scalar #364
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Open
      
      
            ripa1995
  wants to merge
  17
  commits into
  dalek-cryptography:main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
runtime-machines:u128-and-scalar
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
                
     Open
            
            u128 and Scalar #364
                    ripa1995
  wants to merge
  17
  commits into
  dalek-cryptography:main
from
runtime-machines:u128-and-scalar
  
      
      
   
              
            Conversation
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
    This is the largest useful bitsize on Scalar values, because the range for the next eligible bitsize, [0, 2^256), contains all Scalar values.
This reverts commit a1a5b4f.
| Dear @cathieyun, @hdevalence, @oleganza; | 
      
  
  Closed
  
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment
  
      
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
Disclaimer: This pull request has been made against
mainand notdevelopsince the latter is unmaintained, while the former has recent updates.Motivations
Allowing bigger inputs increases the landscape of domains in which
bulletproofscan be used.We increased the
bitsizeto 128 and replaced theu64type withu128in many places within the code.We also decided to support
Scalaras input value, and we decided to implement it as a feature of the library, which can be enabled withscalar_range_proof. Also in this case we had to modify the code such thatScalarcould be accepted. To supportScalarwe had to implement the extraction of a single bit from aScalar.Our implementation of the above consists in an indexing of the
Scalar's underlying array of bytes, followed by a shift and mask of the appropriate byte. In both cases where this operation is used, the index is not secret, so the timing and memory access patterns of this operation shouldn't enable any side-channel attack.We think that at the moment there is no bigger
bitsizevalue that can be used together withScalar, because the range for the next eligiblebitsize(i.e.,[0, 2^256)), contains all possibleScalarvalues.Changes
rust-toolchaintonightly-2023-01-01and Rust edition inCargo.tomlto2021.curve25519-dalekto3.2.1,sha3anddigestto0.9, andmerlinto3.scalar_range_prooffeature, which allowsRangeProofto be used withScalar.bitsizeof 128 and make use ofu128instead ofu64in range proof.u128andScalaras input.u128andScalaras input.InnerProductProofandinner_productpublic.Extras
This PR also solves issues #359 and #363.